<?php
/**
* @author: Pham Van Diep
* @date: 26/2/2014
*/
$strUrlBack = isset($_SESSION[SESSION_BACKURL]) ? $_SESSION[SESSION_BACKURL] : HOST_BACKEND;
if( !isset($AppUI) || 	
    !isset($_SESSION['personal'])||    
    ($_SESSION['personal']&1<<2) == 0 ||
	!isset($_GET['personalid'])
) {
	redirect($strUrlBack);
}
$intPersonalId    = intval($_GET['personalid']);
$row   = $this->personal->get($intPersonalId);
if($row == null) {
   $_SESSION['PERSONAL_ERROR'] = $intPersonalId.' not found.';
}else{
	$arrFeatures = isset($row->features) ? json_decode($row->features):array();
	$this->smarty->assign('arrFeatures',$arrFeatures);
}
$this->load->library('common');
$arrNational = $this->common->getCountry();
$this->smarty->assign('arrNational', $arrNational);
$this->smarty->assign('intPersonalId', $intPersonalId);
$this->smarty->assign('row', $row);
$this->smarty->assign('back', $strUrlBack);
$this->smarty->display('personal/edit.tpl');